Distributed parallel build system

ABSTRACT

This document describes, among other things, systems and methods for managing distributed parallel builds. A computer-implemented method to manage parallel builds, comprises identifying one or more software components in a software project, wherein each software component includes an executable binary file; determining a build configuration for each software component, wherein the build configuration includes a mapping from each software component to one or more build servers; and building each software component using the mapped one or more build servers in the corresponding build configuration, wherein the building includes compiling one or more source files associated with each software component to one or more object files, by distributing the one or more source files to one or more compilation machines.

RELATED PATENT DOCUMENTS

This patent application claims the benefit of priority, under 35 U.S.C.Section 119(e), to U.S. Provisional Patent Application Ser. No.70/744,039, entitled “Distributed Parallel Build System,” filed on Mar.31, 2006, the contents of which are hereby incorporated by reference inits entirety.

TECHNICAL FIELD

Embodiments relate generally to the field of software development, andmore specifically to methods and systems that build software projects inparallel.

BACKGROUND

The software development process usually involves several stepsincluding analyzing requirements, drafting specifications, designing thesoftware architecture, coding, testing and debugging, and maintenance.During the coding, testing, and debugging stages some or all of asoftware project is built using tools such as a compiler and a linker.In a complex software project, builds may take long periods of time,causing an inefficient use of software development resources.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a schematic block diagram of a network-based system,in accordance with an example embodiment;

FIG. 2 illustrates a schematic block diagram of a build manager, inaccordance with an example embodiment;

FIG. 3 illustrates a schematic block diagram of a component-basedarrangement, in accordance with an example embodiment;

FIG. 4 is a chart illustrating build configurations for softwarecomponents, in accordance with an example embodiment;

FIG. 5 illustrates a method for component-based distributed parallelbuilds, in accordance with an example embodiment;

FIG. 6 illustrates a schematic block diagram of build servers andcompilation machines, in accordance with an example embodiment; and

FIG. 7 illustrates a diagrammatic representation of a machine in theexemplary form of a computer system, within which a set or sequence ofinstructions for causing the machine to perform any one of themethodologies discussed herein may be executed.

DETAILED DESCRIPTION

Methods and systems to manage software builds in a network-based systemare described. In the following description, for purposes ofexplanation, numerous specific details are set forth in order to providea thorough understanding of embodiments of the inventive subject matter.It will be evident, however, to one skilled in the art that embodimentsof the inventive subject matter may be practiced without these specificdetails.

For the purposes of this document, “software component” includes anyindependent binary or independent executable software module, such aslibrary files (e.g., dynamically linked libraries or DLL), executablefiles (e.g., applications or .exe files), or services (e.g., daemons).Other types of independent binaries are included as understood by one ofordinary skill in the art.

FIG. 1 illustrates a schematic block diagram of a network-based system100, in accordance with an example embodiment. The network-based system100 includes a web server 102, which can communicate over a network 104with one or more terminals 106A, 106B, 106C, . . . , 106N. In variousembodiments, portions of the network 104 may include wired or wirelessnetworking. The terminals 106 can connect to the network 104 using wiredor wireless communication. The web server 102 is communicatively coupledto a database 108 and other backend servers, such as an email server110, a database engine server 112, and a file server 114. Additionally,the system 100 includes one or more build servers 116A, 116B, 116C, . .. , 116N. In embodiments, the build servers 116 may include any type ofcomputer including a laptop, desktop, blade server, network server, orthe like. In addition, build servers 116 may include one or moresoftware compilers 118 or linkers 120.

In an embodiment, a user (e.g., a software developer) can use a terminalmachine 106 to control software builds using a web-based user-interfaceprovided by the web server 102. In an embodiment, a user (e.g., asoftware developer) can use a terminal machine 106 to control softwarebuilds using a web-based user-interface provided by the web server 102.During a typical software development phase, the user may write and editfiles, which are part of a software project. At some time, the user maydesire to build the project. Building the project may involve compilingone or more files and then linking them into one or more files (e.g.,executable or library files). In an embodiment, the user can initiatesuch a build process using the user-interface provided by the web server102. Upon receiving such a request, the web server 102 communicates withthe database engine server 112. Communication may include informationsuch as user identification, project identification, build destination,and other pertinent information. The database engine server 112 can thencommunicate with the database 108 to determine the files needed and thecorrect commands to issue to the build servers 116. Files may be storedin the database 108 or on a file server 114. Files for each particularsoftware component are associated with one or more build servers 116 ina distributed manner. In an embodiment, each build server 116 contains acompiler and a linker. The files are transmitted to the associated buildservers 116, where they are compiled and linked. After each softwarecomponent is compiled and linked on the distributed build servers 116,the software project (e.g., the collection of the particular softwarecomponents) is transmitted to a development or a release area.

FIG. 2 illustrates a schematic block diagram of a build manager 200, inaccordance with an example embodiment. The build manager 200 mayoperate, in some embodiments, as a build server 220. In such anembodiment, the build manager 200 can compile one or more files whilealso coordinating the distributed parallel build process. Alternatively,the build manager 200 may be solely operated as a controller machine:taking commands from a client machine 202, managing the build process,and placing final builds on either a development system 204 or a releasesystem 206.

In an embodiment, the build manager 200 includes a user interface module208, an error handling module 210, a scheduling module 212, a queuingmodule 214, a file transfer module 216, a compiler 215, and a linker217. Users (e.g., software developers) may connect with the buildmachine 200 from their client machines 202 to issue one or more commandsthat control software builds. For example, a user may issue a commandvia the user interface module 208 to schedule a build or a series ofbuilds, cancel a build or check the status of a build.

The scheduling module 212 may be used to schedule one or more builds inthe future. In an embodiment, users can schedule one or more builds tocommence at a specific time or date. In another embodiment, users canschedule periodic or recurring builds. Schedules of periodic orrecurring builds may have a terminating date or time, such that softwareprojects will regularly re-build until the terminating date or time.

The error handling module 210 detects errors that may occur before orduring a build. In an embodiment, detected errors are logged to adatabase 218 or a file. Users may, in some embodiments, view the errorsstored in the database 218 using the user interface module 208. In someembodiments, the error handling module 210 may communicate with one ormore modules to control current or later builds. For example, if a buildfails and the error handling module 210 detects a certain type of erroror a certain degree of error, the error handling module 210 maycommunicate with the scheduling module 212 to discontinue future buildsor defer the next scheduled build until, for example, the user isnotified and issues a command to continue the scheduled builds. Inanother embodiment, after detecting an error, the error handling module210 may communicate with the queuing module 214 to remove any queuedportions of the build not yet in progress, thereby terminating thebuild.

The queuing module 214 manages user build requests using one or morequeues, in embodiments. In an embodiment, queuing is sorted by afirst-come, first-served priority basis. In other embodiments, queuingis prioritized using factors such as a project type, a requestor, aproject size, a project priority, or the like. In an embodiment, thequeuing module 214 may communicate with the scheduling module 212 toreceive scheduled builds. The queuing module 214 may then insert thescheduled builds into a queue based on one or more of the factors notedabove. In an embodiment, queuing is performed at the project level, suchthat a project may not begin building until a previous project iscompleted. In another embodiment, queuing is performed at a moregranular level, such as at a component or file level. It may beadvantageous to manage queues at a finer granularity to reduce buildserver 220 idle time. In an embodiment, the queuing module 214communicates with the database 218 to update the build status. Forexample, the queuing module 214 may communicate with the user interfacemodule 208 to provide an indication of which software project orsoftware component is currently being built, which project or componentis next in the queue, or indications of success or error conditionsexisting in the current software build.

In an embodiment, the file transfer module 216 can transfer source filesto one or more build servers 220. Source files may be stored on a fileserver, removable storage media, or a structured storage system, such asa database, version control system, or the like. In one embodiment,source files are stored in Rational ClearCase provided by IBM, Inc. Inan embodiment, the build servers 220 compile the source files to objectfiles. In another embodiment, the build servers 220 manage thedistributed compilation of the source files across one or morecompilation machines. The file transfer module 216 may then transfer theresultant object file from each build server 220 to another server,which may in some embodiments be the build manager 200, where linking isperformed. In an alternative embodiment, linking is performed by one ormore build servers 220 and the file transfer module 216 accesses thelinked executable file. In either embodiment, the linked executable fileis eventually transferred to the development system 204 or the releasesystem 206. In embodiments, file transfers are performed using secured(e.g., Secure Shell (SSH)) or unsecured (e.g., TCP/IP) protocols. In anembodiment, the file transfer module 216 communicates with the database218 to update the status of file transfers.

FIG. 3 illustrates a schematic block diagram of a component-basedarrangement 300, in accordance with an example embodiment. In anembodiment, a project 302 may be divided into several softwarecomponents. In one example embodiment, the project may include an onlinecommerce system, where the software components include a user accountmanager 304A, a payment system 304B, a shopping cart 304C, a cataloginterface 304D, and a feedback module 304E. Each component 304 may belogically divided further into separate files or sets of files 306A,306B, . . . , 306N representing a subdivision of the component 304related in some manner, such as by related functionality, complexity, orthe like. In an embodiment, the subdivided files or sets of files 306are organized in a manner that increases the speed or efficiency of thebuild process. For example, one or more complex files may be associatedwith a more powerful build server 116 (FIG. 1), whereas less complexfiles may be associated with a less powerful build server 116, in orderto seek overall efficiency gains.

FIG. 4 is a chart 400 illustrating build configurations for softwarecomponents, in accordance with an example embodiment. As depicted inFIG. 4, a build configuration for a software component includes amapping from a particular software component to one or more servers. Forexample, each software component in the component column 402 isassociated with one or more computing machines in the server column 404.A command can be issued to compile a component in a distributed mannerusing the machines identified in the server column 404. In anembodiment, the machines, as described in column 404, include a buildserver. In another embodiment, the machines include a computing devicededicated to compiling or assembling source code to object code, such asa compilation machine. In an embodiment, a software tool is used tomanage and facilitate distributed compilation, such as for example,distcc by Martin Pool. The number of servers and which servers are usedfor each component may be determined by one or more factors, includingthe size of the component, the complexity of the component, thecomputational capability of each build server, the typical frequency ofchanges to a particular component, the network capabilities to one ormore servers, and other factors that may be considered when attemptingto optimize build times. In an embodiment, where two or more componentsare of sufficiently simple complexity to maintain overall buildefficiency, portions or all of the components may be compiled or builton a single build server.

In an embodiment, mapping is performed by the build manager 200 on afirst-come first-served basis. For example, a list of one or moresoftware components may be submitted to a user interface provided by theuser interface module 208. The build manager 200 may process the list ofsoftware components from first to last and map each software componentto one or more build servers depending on one or more factors, aspreviously described. The build manager 200 may be aware of how manybuild servers are available and what each build server's configurationis, for example memory, processing capability, or the like. Using suchinformation, the build manager 200 may adaptively map (assign) softwarecomponents to build servers in an effort to balance processing duties oran attempt to achieve an overall maximized operating efficiency. Inanother embodiment, mapping is performed based on one or morecharacteristics of the software components, such as the size,complexity, age, name, priority, language, or the like. Usingcharacteristics of the software components may be advantageous byproviding the best resources to the most complex components beforemapping other less complex components, which may not fully maximize abuild server's capabilities. In another embodiment, mapping is performedby dividing the number of available build servers by the number ofsoftware components and then assigning the allotted number of buildservers to each software component.

FIG. 5 illustrates a method 500 for component-based distributed parallelbuilds, in accordance with an example embodiment. At 502, each componentis identified. In one embodiment, a command is issued by a user of thesystem 100 using a user-interface provided on a terminal machine 106.The command can include an indication of one or more components tobuild. The method 500 can parse the command to determine the components.

For each component 504, the method 500 determines the buildconfiguration for the component 506. For example, using a table similarto the one illustrated in FIG. 4, the method 500 can determine whichbuild servers 116 (FIG. 1) will be targeted for the distributedcompilation of the particular component.

At 508, one or more commands are issued to distributively compile thecomponent. In an embodiment, the command identifies one or more buildservers 116 to be used to compile the particular component. In anembodiment, one or more components are built using one or more assignedbuild servers 116, where building a component includes compiling andlinking the component's source files. In another embodiment, componentsource files are only compiled on build servers 116 in a distributedmanner, and linking the resulting object code is performed on adifferent computer. In another embodiment, build servers 116 control thedistributed compilation of one or more components using one or morecompilation machines.

At 510, the current build status is updated for later use, for example,by a report or a user-interface screen to be provided to a user showingthe current status of each component build.

In certain embodiments, some or all of the builds can be scheduled. Inother embodiments, some or all of the builds can be performed in serial,parallel, or a combination. This may be necessary, for example, becauseof inherent dependencies between different units of software.

In an embodiment, a build is distributed over two or more CPUs in asingle machine, such that, for example, each component is assigned andassociated with one or more CPUs in the machine. In another embodiment,a machine has a multiple-core CPU (e.g., AMD Athlon X2 series and IntelPentium D processors) and a build can be distributed over two or moreCPU cores in a single machine. In a further embodiment, a machine mayhave multiple CPUs, each with multiple CPU cores, and systems andmethods described herein can adaptively associate and assign componentsin a project to particular CPUs or CPU cores or any combination of thetwo. In a further embodiment, builds can be distributed over severalmulti-processor machines, where each machine's processors may or may nothave multiple cores. Components can then be assigned to a particularprocessor on a particular machine or even with more granularities, suchas by assigning a certain component build to one or more processor coreson a particular machine or across several machines.

FIG. 6 illustrates a schematic block diagram of build servers 600 andcompilation machines 602, in accordance with an example embodiment. Inone configuration, multiple build servers 600A, 600B, 600C, . . . , 600Nare arranged in a hierarchal tree, such that a root build server 600Ahas the task of distributing one or more software components of asoftware project to one or more component-level build servers 600B,600C, . . . , 600N. In some embodiments, the root build server 600Aincludes a linker, a packager (e.g., Red Hat Package Manager) and othersoftware to distribute and manage distributed compilations such that theroot build server 600A may act as a component-level build server duringa separate project build. In an embodiment, the packager includessoftware to create a software package using a particular file format,such that a management tool can install, update, uninstall, verify andquery software packaged in the format. Component-level build servers600B, 600C, . . . , 600N include a linker, software to distribute andmanage distributed compilations, and a packager. Compilation machines602A, 602B, 602C, . . . , 602N includes one or more compilers and areconfigured as dedicated machines with a primary task of compiling sourcecode to object code, in an embodiment.

In an embodiment, after a build command is submitted to the root buildserver 600A, components of the software project are distributed to thecomponent-level build servers 600B, 600C, . . . , 600N. In anotherembodiment, each component-level build server 600B, 600C, . . . , 600Nis provided with a component identifier, such as a component name, andmay retrieve the source files associated with the component from acentral repository, such as a version control system. At eachcomponent-level build server 600B, 600C, . . . , 600N, the source filesthat are associated with the component are distributed across thecompilation machines 602 using software, such as distcc, where thesource files are compiled to object files. In one embodiment, aconfiguration file maps software components to one or more compilationmachines 602. The configuration file may be stored in a centralrepository. When a component-level build server 600B, 600C, . . . , 600Nreceives a build command identifying the component to build, theassociated configuration file may be retrieved and used to determine thetarget compilation machines 602 for the distributed compilation. Afterthe source files are compiled, the object files are linked at thecomponent-level build server 600B, 600C, . . . , 600N and the resultingsoftware component (e.g., executable file or library file) is packagedusing the packager. The package can then be transferred to a developmentplatform 604 or a release platform 606, where it can be installed andused or tested. In an embodiment, development platform 604 may includeone or more development servers 604A, 604B to provide paralleldevelopment and testing. In an embodiment, packages from component-levelbuild server 600B, 600C, . . . , 600N are mustered at a staging area608, before being distributed to the development platform 604 or therelease 606. In various embodiments, the staging area may include one ormore file servers, database servers, or the like, to temporarily storethe packages before distribution. The staging area 608 may validate thatall packages in a software project are present before transferring theproject (e.g., in the form of a complete set of packages) to theappropriate target platform.

FIG. 7 illustrates a diagrammatic representation of a machine in theexemplary form of a computer system 700 within which a set or sequenceof instructions, for causing the machine to perform any one of themethodologies discussed herein, may be executed. In alternativeembodiments, the machine may comprise a computer, a network router, anetwork switch, a network bridge, Personal Digital Assistant (PDA), acellular telephone, a web appliance, set-top box (STB) or any machinecapable of executing a sequence of instructions that specify actions tobe taken by that machine.

The computer system 700 includes a processor 702, a main memory 706 anda static memory 708, which communicate with each other via a bus 724.The computer system 700 may further include a video display unit 712(e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)). Thecomputer system 700 also includes an alphanumeric input device 714(e.g., a keyboard), a cursor control device 716 (e. g., a mouse), a diskdrive unit 717, a signal generation device 722 (e.g., a speaker) and anetwork interface device 710 to interface the computer system to anetwork 726.

The disk drive unit 718 includes a machine-readable medium 720 on whichis stored a set of instructions or software 704 embodying any one, orall, of the methodologies described herein. The software 704 is alsoshown to reside, completely or at least partially, within the mainmemory 706 and/or within the processor 702. The software 704 may furtherbe transmitted or received via the network interface device 710. For thepurposes of this specification, the term “machine-readable medium” shallbe taken to include any medium which is capable of storing or encoding asequence of instructions for execution by the machine and that cause themachine to perform any one of the methodologies of the inventive subjectmatter. The term “machine-readable medium” shall accordingly be taken toinclude, but not be limited to, solid-state memories, optical andmagnetic disks, and carrier wave signals. Further, while the software isshown in FIG. 7 to reside within a single device, it will be appreciatedthat the software could be distributed across multiple machines orstorage media, which may include the machine-readable medium.

The foregoing description of specific embodiments reveals the generalnature of the inventive subject matter sufficiently that others can, byapplying current knowledge, readily modify and/or adapt it for variousapplications without departing from the generic concept. Therefore, suchadaptations and modifications are within the meaning and range ofequivalents of the disclosed embodiments. The phraseology or terminologyemployed herein is for the purpose of description and not of limitation.Accordingly, the inventive subject matter embraces all suchalternatives, modifications, equivalents and variations as fall withinthe spirit and broad scope of the appended claims.

Method embodiments described herein may be computer-implemented. Someembodiments may include computer-readable media encoded with a computerprogram (e.g., software), which includes instructions operable to causean electronic device to perform methods of various embodiments. Asoftware implementation (or computer-implemented method) may includemicrocode, assembly language code, or a higher-level language code,which further may include computer readable instructions for performingvarious methods. The code may form portions of computer programproducts. Further, the code may be tangibly stored on one or morevolatile or non-volatile computer-readable media during execution or atother times. These computer-readable media may include, but are notlimited to, hard disks, removable magnetic disks, removable opticaldisks (e.g., compact disks and digital video disks), magnetic cassettes,memory cards or sticks, random access memories (RAMS), read onlymemories (ROMs), and the like.

In the foregoing description of various embodiments, reference is madeto the accompanying drawings, which form a part hereof and show, by wayof illustration, specific embodiments in which the inventive subjectmatter may be practiced. Various embodiments are described in sufficientdetail to enable those skilled in the art to practice the inventivesubject matter, and it is to be understood that other embodiments may beutilized, and that process or mechanical changes may be made, withoutdeparting from the scope of the inventive subject matter.

Embodiments of the inventive subject matter may be referred to,individually and/or collectively, herein by the term “inventive subjectmatter” merely for convenience and without intending to voluntarilylimit the scope of this application to any single inventive subjectmatter or inventive concept if more than one is, in fact, disclosed. Itwill be recognized that the methods of various embodiments can becombined in practice, either concurrently or in succession. Variouspermutations and combinations may be readily apparent to those skilledin the art.

1. A computer-implemented method to manage parallel builds, comprising:identifying one or more software components in a software project,wherein each software component includes an executable binary file;determining a build configuration for each software component, whereinthe build configuration includes a mapping from each software componentto one or more build servers; and building each software component usingthe mapped one or more build servers in the corresponding buildconfiguration, wherein the building includes compiling one or moresource files associated with each software component to one or moreobject files, by distributing the one or more source files to one ormore compilation machines.
 2. The method of claim 1, further comprisingscheduling one or more builds.
 3. The method of claim 2, wherein thescheduling is periodic or recurring.
 4. The method of claim 1, furthercomprising queuing one or more builds.
 5. The method of claim 4, whereinthe queuing is based on one or more of a project type, a requestor, aproject size, a project priority or a project request time.
 6. Themethod of claim 4, wherein the queuing is organized by one or more of aproject-level, a component-level, or a file-level.
 7. The method ofclaim 1, wherein building each software component includes: linking theone or more object files associated with each software component;packaging each software component; and transferring each packagedsoftware component to one of a development area or a release area.
 8. Adevice comprising: a user-interface module; a queuing module, coupled tothe user-interface module, the queuing module configured to maintain abuild queue, the build queue including one or more build requests, eachbuild request including one or more software components; and a filetransfer module, coupled to the queuing module, configured to transferone or more files associated with one or more software componentsassociated with a build request in the build queue to one or more buildservers according to a build configuration, wherein the buildconfiguration includes a mapping from each software component to one ormore build servers.
 9. The device of claim 8, further comprising ascheduling module, coupled to the user-interface module and the queuingmodule, configured to manage one or more scheduled builds.
 10. Thedevice of claim 8, further comprising an error handling module, coupledto the user-interface module and the queuing module, configured todetect one or more error conditions and perform one or more actions inresponse to the detected error conditions.
 11. The device of claim 10,wherein the actions include one or more of reporting the error conditionto the user-interface, logging the error condition, or ignoring theerror condition.
 12. A computer-assisted method of managing parallelbuilds, comprising: means for organizing a software project into one ormore software components, wherein each software component is associatedwith an executable binary file; means for determining a buildconfiguration for each software component, wherein the buildconfiguration includes a mapping from each software component to one ormore build servers; and means for compiling each software componentusing the build configuration.
 13. A computer-readable medium includinginstructions that, when performed by a computer, cause the computer to:identify one or more software components in a software project, whereineach software component includes an executable binary file; determine abuild configuration for each software component, wherein the buildconfiguration includes a mapping from each software component to one ormore build servers; and compile each software component using the mappedone or more build servers in the corresponding build configuration. 14.The computer-readable medium of claim 13, further comprisinginstructions that cause the computer to schedule one or more builds. 15.The computer-readable medium of claim 13, further comprisinginstructions that cause the computer to queue one or more builds. 16.The computer-readable medium of claim 15, wherein the queuing is basedon one or more of a project type, a requestor, a project size, a projectpriority or a project request time.
 17. The computer-readable medium ofclaim 15, wherein the queuing is organized by one or more of aproject-level, a component-level, or a file-level.
 18. Thecomputer-readable medium of claim 13, further comprising instructionsthat cause the computer to: link each software component; and transfereach compiled and linked software component to one of a development areaor a release area.